//
//  CommentDetailViewController.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/7/24.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "CommentDetailViewController.h"
#import "CommentCell.h"
@interface CommentDetailViewController ()<UITableViewDelegate,UITableViewDataSource>

@property(nonatomic,strong)UITableView *tableView;


@end

@implementation CommentDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"评论";
    [self createTableViewUI];
    // Do any additional setup after loading the view.
}
-(void)createTableViewUI{
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, WIDTH, HEIGHT - 64) style:UITableViewStylePlain];
    [self.view addSubview:self.tableView];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    UINib *nib = [UINib nibWithNibName:@"CommentCell" bundle:nil];
    [self.tableView registerNib:nib forCellReuseIdentifier:@"CommentCell"];
    self.tableView.estimatedRowHeight = 200;
    [self.tableView reloadData];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 20;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *cellId = @"CommentCell";
    CommentCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    return cell;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
